home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / c_lib01.arc / DISPIO.H < prev    next >
Text File  |  1985-10-16  |  2KB  |  62 lines

  1.  
  2. /*                        Listing 4
  3.                     C to Assembly Interface
  4.       Computer Language, Vol. 2, No. 2 (February, 1985), pp. 49-59
  5.                          Include file
  6. */
  7. /* See IBM Personal Computer Reference Manual.
  8.    For August, 1981 edition, pp. 43-45.
  9.    For April, 1983 edition, pp. 45-47. */
  10. /* Modified by Lew Paper.  Upper cases and additions */
  11.  
  12. #define PAGE 0
  13.  
  14.  /* video modes */
  15. #define S40X25_BW 0
  16. #define S40X25_COLOR 1
  17. #define S80X25_BW 2
  18. #define S80X25_COLOR 3
  19. #define MED_COLOR 4
  20. #define MED_BW 5
  21. #define HIGH_BW 6
  22.  
  23.  /* Lower right hand corners of screen */ /* L.P. */
  24. #define LRH80 0x244f
  25. #define LRH40 0x2427
  26.  
  27.  /* Character attributes */ /* L.P. */
  28. #define STD_CHAR 0x07         /* White on black */
  29. #define UND_CHAR 0x01         /* Underline white on black */
  30. #define HI_CHAR 0x0f          /* High intensity white on black */
  31. #define UND_HI_CHAR 0x09      /* Underline high intensity white on black */
  32. #define REV_STD_CHAR 0x70     /* Black on white */
  33.  
  34.  /* video functions */
  35. #define SET_TYPE 256                  /* AH = 1, AL = 0 */
  36. #define SET_CUR 512                   /* AH = 2, AL = 0 */
  37. #define READ_POSITION 768             /* AH = 3, AL = 0 */
  38. #define READ_LIGHT_PEN_POSITION 1024  /* AH = 4, AL = 0 */
  39. #define SELECT_PAGE 1280              /* AH = 5, AL = 0 */
  40. #define SCROLL_UP 1536                /* AH = 6, AL = 0 */
  41. #define SCROLL_DN 1792                /* AH = 7, AL = 0 */
  42. #define READ_ATTRIBUTE_CHAR 2048      /* AH = 8, AL = 0 */
  43. #define WRITE_ATTRIBUTE_CHAR 2304     /* AH = 9, AL = 0 */
  44. #define WRITE_CHAR 2560               /* AH = 10, AL = 0 */
  45. #define SET_PALETTE 2816              /* AH = 11, AL = 0 */
  46. #define WRITE_DOT 3072                /* AH = 12, AL = 0 */
  47. #define READ_DOT 3328                 /* AH = 13, AL = 0 */
  48. #define WRITE_TELETYPE 3584           /* AH = 14, AL = 0 */
  49. #define GET_STATE 3840                /* AH = 15, 1L = 0 */
  50.  
  51. #define READ_TYPE 0x1000              /* L.P. */
  52. #define READ_LOC 0x1100               /* L.P. */
  53.  
  54. int curset();
  55. int dispio(), read_loc(), read_typ(), write_ac(), write_ch(), writ_tty();
  56. int c40_disp(), c80_disp(), mono_dsp();
  57.  
  58.  /* macros */
  59. #define CURPOS(ROW,COL) dispio(SET_CUR,PAGE,(((int)ROW<<8)+COL)
  60. #define WRTCHAR(CH) write_ch(CH,PAGE,1)
  61.  
  62.